﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="discusList.aspx.vb" Inherits="WSADProject.discusList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    
    
        

        <div id ="createdisscussion">
                <asp:Button ID="btnDiscuss" runat="server" Text="Create Discussion Topic" />
        <asp:Button ID="Button4" runat="server" Text="Button" style="display:none"/>
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="Button4" PopupControlID="pnlpopup"
CancelControlID="btnCancel" BackgroundCssClass="modalBackground">
</ajaxToolkit:ModalPopupExtender>
<asp:Panel ID="pnlpopup" runat="server" BackColor="White" style="display:none">
    <asp:TextBox ID="txtTopic" runat="server" TextMode="MultiLine" Height="82px" Width="205px" ></asp:TextBox>
<br /><asp:Button ID="btnAdd" CommandName="Update" runat="server" Text="Insert Topic"/>
<asp:Button ID="btnCancel" runat="server" Text="Cancel" />
</asp:Panel>
                <asp:Label ID="lblmess" runat="server" ForeColor="Red" Text="Loggin to add a Topic on fishing." Visible="False"></asp:Label>
                <br />
                <asp:ListView ID="ListView2" runat="server" DataKeyNames="DiscussionID" DataSourceID="SqlDataSource1">
                    <AlternatingItemTemplate>
                        <li style="">Topic:
                              <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl ='<%# String.Format("~/Discussreply.aspx?DiscusID={0}", Eval("DiscussionID"))%>' ><%# Eval("DiscussionSubject") %> </asp:HyperLink>
                            <br />
                            Created By:
                            <asp:Label ID="UsernameLabel" runat="server" Text='<%# Eval("Username") %>' />
                            <br />
                            Created Date:
                            <asp:Label ID="CreatedDateLabel" runat="server" Text='<%# Eval("CreatedDate", "{0:d}")%>' />
                            <br />
                            Created Time:
                            <asp:Label ID="CreatedTimeLabel" runat="server" Text='<%# Eval("CreatedTime", "{0:T}")%>' />
                            <br />
                        </li>
                    </AlternatingItemTemplate>
                    <EditItemTemplate>
                        <li style="">DiscussionID:
                            <asp:Label ID="DiscussionIDLabel1" runat="server" Text='<%# Eval("DiscussionID") %>' />
                            <br />
                            DiscussionSubject:
                            <asp:TextBox ID="DiscussionSubjectTextBox" runat="server" Text='<%# Bind("DiscussionSubject") %>' />
                            <br />
                            Username:
                            <asp:TextBox ID="UsernameTextBox" runat="server" Text='<%# Bind("Username") %>' />
                            <br />
                            CreatedDate:
                            <asp:TextBox ID="CreatedDateTextBox" runat="server" Text='<%# Bind("CreatedDate") %>' />
                            <br />
                            CreatedTime:
                            <asp:TextBox ID="CreatedTimeTextBox" runat="server" Text='<%# Bind("CreatedTime") %>' />
                            <br />
                            <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
                            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                        </li>
                    </EditItemTemplate>
                    <EmptyDataTemplate>
                        No Discussion Available. Please create one.
                    </EmptyDataTemplate>
                    <InsertItemTemplate>
                        <li style="">DiscussionSubject:
                            <asp:TextBox ID="DiscussionSubjectTextBox" runat="server" Text='<%# Bind("DiscussionSubject") %>' />
                            <br />Username:
                            <asp:TextBox ID="UsernameTextBox" runat="server" Text='<%# Bind("Username") %>' />
                            <br />CreatedDate:
                            <asp:TextBox ID="CreatedDateTextBox" runat="server" Text='<%# Bind("CreatedDate") %>' />
                            <br />CreatedTime:
                            <asp:TextBox ID="CreatedTimeTextBox" runat="server" Text='<%# Bind("CreatedTime") %>' />
                            <br />
                            <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
                            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />
                        </li>
                    </InsertItemTemplate>
                    <ItemSeparatorTemplate>
<br />
                    </ItemSeparatorTemplate>
                    <ItemTemplate>
                         <li style="">
                             Topic:
                              <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl ='<%# String.Format("~/Discussreply.aspx?DiscusID={0}", Eval("DiscussionID"))%>' ><%# Eval("DiscussionSubject") %> </asp:HyperLink>
                            <br />
                            Created By:
                            <asp:Label ID="UsernameLabel" runat="server" Text='<%# Eval("Username") %>' />
                            <br />
                            Created Date:
                            <asp:Label ID="CreatedDateLabel" runat="server" Text='<%# Eval("CreatedDate", "{0:d}")%>' />
                            <br />
                            Created Time:
                            <asp:Label ID="CreatedTimeLabel" runat="server" Text='<%# Eval("CreatedTime", "{0:T}")%>' />
                            <br />
                        </li>
                    </ItemTemplate>
                    <LayoutTemplate>
                        <ul id="itemPlaceholderContainer" runat="server" style="">
                            <li runat="server" id="itemPlaceholder" />
                        </ul>
                        <div style="">
                            <asp:DataPager ID="DataPager1" runat="server">
                                <Fields>
                                    <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                    <asp:NumericPagerField />
                                    <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                </Fields>
                            </asp:DataPager>
                        </div>
                    </LayoutTemplate>
                    <SelectedItemTemplate>
                        <li style="">DiscussionID:
                            <asp:Label ID="DiscussionIDLabel" runat="server" Text='<%# Eval("DiscussionID") %>' />
                            <br />
                            DiscussionSubject:
                            <asp:Label ID="DiscussionSubjectLabel" runat="server" Text='<%# Eval("DiscussionSubject") %>' />
                            <br />
                            Username:
                            <asp:Label ID="UsernameLabel" runat="server" Text='<%# Eval("Username") %>' />
                            <br />
                            CreatedDate:
                            <asp:Label ID="CreatedDateLabel" runat="server" Text='<%# Eval("CreatedDate") %>' />
                            <br />
                            CreatedTime:
                            <asp:Label ID="CreatedTimeLabel" runat="server" Text='<%# Eval("CreatedTime") %>' />
                            <br />
                        </li>
                    </SelectedItemTemplate>
                </asp:ListView>
   </div> 
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:fishconn %>" ProviderName="<%$ ConnectionStrings:fishconn.ProviderName %>" SelectCommand="SELECT [DiscussionID], [DiscussionSubject], [Username], [CreatedDate], [CreatedTime] FROM [tblDiscussion] Order By [CreatedDate], [CreatedTime]"></asp:SqlDataSource>
        <asp:HiddenField ID="hiddenUserName" runat="server" />
</asp:Content>
